#pragma once
#include <Arduino.h>
#include <Wire.h>
#include <Adafruit_INA219.h>
#include <Adafruit_AHTX0.h>
#include <MPU6050_tockn.h>

struct DolyMPUData {
  float acc_x;
  float acc_y;
  float acc_z;
  float gyro_x;
  float gyro_y;
  float gyro_z;
  float temp;
  float acc_angle_x;
  float acc_angle_y;
  float gyro_angle_x;
  float gyro_angle_y;
  float gyro_angle_z;
  float angle_x;
  float angle_y;
  float angle_z;
};

struct BoadrInfoData {
  float temperature;
  float humidity;
  float loadvoltage;
  float current_mA;
  float power_mW;
  float total_mAH;
  DolyMPUData mpu_data;
};

class BoardInfo {
 private:
  TwoWire i2c_;
  MPU6050 mpu6050_;
  Adafruit_AHTX0* aht{nullptr};
  Adafruit_INA219* ina219{nullptr};
  uint32_t total_sec = 0;
  float total_mA = 0.0;

 public:
  BoardInfo();
  ~BoardInfo();
  bool Start();
  void UpdateMPU();
  BoadrInfoData Get();
  void print(const BoadrInfoData& data);
};
